package com.symaster.common.geom.canvas.repeater;

import java.awt.*;
import java.awt.event.MouseEvent;
import java.awt.event.MouseMotionListener;

/**
 * @author yinmiao
 * @version 2022-07-14 15:29
 */
public class CanvasMouseMotionListenerRepeater extends BaseRepeater implements MouseMotionListener {

    private final MouseMotionListener dstRepeater;

    public CanvasMouseMotionListenerRepeater(Component component, MouseMotionListener dstRepeater) {
        super(component);
        this.dstRepeater = dstRepeater;
    }

    @Override
    public void mouseDragged(MouseEvent e) {
        dstRepeater.mouseDragged(generateRepeaterMouseEvent(e));
    }

    @Override
    public void mouseMoved(MouseEvent e) {
        dstRepeater.mouseMoved(generateRepeaterMouseEvent(e));
    }
}
